Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Configure Flutter CI #383

Merged
merged 6 commits into from
Mar 9, 2018
Merged

Configure Flutter CI #383

merged 6 commits into from
Mar 9, 2018

Conversation

fkorotkov
Copy link
Contributor

Cirrus CI recently added Flutter support by providing Docker images with Flutter pre-installed. It allows to avoid boilerplate of setting up an environment which makes it possible to start tests execution in a few hundred milliseconds from the moment a change is pushed to GitHub.

For this repository particularly I've seen CI times from 12 to 15 minutes for the longest part of the build (building apks). It's 2 to 3 times faster comparing to the current CI setup.

Unfortunately flutter_plugin_tools can't run things in parallel and take advantage of up to 8 cores that Cirrus CI can provide.

Here is a build for that particular change:

image

I was testing Flutter support on this repository and decided to share the results. Feel free to close the PR if not interested in a better CI. Didn't want to waste my work 😅

In case you will merge the PR. Don't forget to install Cirrus CI application from Github Marketplace as described in Quick Start guide.

@Hixie
Copy link
Contributor

Hixie commented Feb 15, 2018

This is interesting. What version of Flutter does it test against?

cc @mravn-google

@fkorotkov
Copy link
Contributor Author

@Hixie it uses cirrusci/flutter:0.1.0 Docker container image which has Flutter 0.1.0 pre-installed. There is 0.1.1 version available so I can bump it if you want.

BTW cirrusci/flutter:0.1.0 is based on cirrusci/android-sdk:26 image which has everything for Android development so it is possible to run an Android emulator using cirrusci/flutter images for integration tests.

@fkorotkov
Copy link
Contributor Author

cc @sethladd and @yjbanov since we have an ongoing email thread about Cirrus CI for Flutter projects.

@Hixie
Copy link
Contributor

Hixie commented Feb 15, 2018

We ship new versions of Flutter multiple times a week. I am worried about using a mechanism that is tied to a particular version. We care about testing against the latest version.

@fkorotkov
Copy link
Contributor Author

fkorotkov commented Feb 15, 2018

Fair point. Added flutter channel master && flutter upgrade which adds a little bit less than a minute to a build. Also removed pub cache to always test against the latest versions of libraries. See https://cirrus-ci.com/build/5708110253522944

Ideally at some point we can work on continuously pushing Docker image for Flutter and having up-to-date latest tag.

@yjbanov
Copy link
Contributor

yjbanov commented Feb 16, 2018

I'll be able to give this more thought after Feb 28. But I'm curious how well-trodden the Emulator/Simulator path is on Cirrus CI. This repository contains lots of Objective-C and Java code that need to be tested in either a simulated environment or real devices. Travis does not make it easy to test in emulators.

@fkorotkov
Copy link
Contributor Author

These images can run an Android emulator. Unfortunately it won't have hardware acceleration since it's a Dockerized environment but, to my knowledge, no hosted CI has hardware accelerated emulators at the moment. Internally we have a design proposal on how to securely add such accelerated emulators but there are other priorities at the moment like adding Mac OS support.

Have a great vacation and let's revisit this PR once you are back 🙌

@gspencergoog gspencergoog requested a review from yjbanov February 21, 2018 22:01
@Hixie Hixie merged commit 0175a2a into flutter:master Mar 9, 2018
@Hixie
Copy link
Contributor

Hixie commented Mar 9, 2018

Ok I've landed this and turned on Cirrus CI! Let's see how it goes!

@fkorotkov fkorotkov deleted the fedor/cirrus-ci branch March 10, 2018 13:53
@fkorotkov
Copy link
Contributor Author

Thank you, @Hixie! Please let me know about any feedback and feel free to tag me on PRs for questions.

jonasbark pushed a commit to jonasbark/plugins that referenced this pull request Mar 20, 2018
* commit 'a404fbfd4842b51b57bc0c6298604cf5674e2c02': (40 commits)
  Update README.md (flutter#430)
  Updated to 0.5.0 (flutter#428)
  AdSizes for AdMob banner ads (flutter#402)
  bump minor version and add changelog entry (flutter#427)
  add fetchProvidersForEmail wrapper (flutter#410)
  Incremental Build Script (flutter#422)
  add runtime permission requests for external storage and camera (flutter#424)
  Fix Dart 2 type error and deprecation (flutter#425)
  Fix a Dart 2 runtime cast failure in firebase_database test (flutter#419)
  Fixed deprecation warnings (flutter#420)
  Fix Dart 2 runtime error in the camera plugin (flutter#417)
  Always use the latest Flutter available (flutter#415)
  Spelling (flutter#411)
  Configure Flutter CI (flutter#383)
  Set SDK constraints to match Flutter beta (flutter#412)
  Remove Gradle artifacts from repo (flutter#414)
  Google maps plugin stub (flutter#405)
  Allow null document snapshot data when document does not exist (flutter#406)
  Fix new formatting errors (flutter#408)
  Fix url_launcher for iOS <10 (flutter#407)
  ...
julianscheel pushed a commit to jusst-engineering/plugins that referenced this pull request Mar 11, 2020
* Configured Cirrus CI

As described in https://cirrus-ci.org/examples/#flutter

* Use Flutter 0.1.0

* always upgrade Flutter to the latest master

* removed pub cache to always to test against the latest version of libraries

* always use the latest available Flutter image

* no upgrade
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants